luci-base: check for wifi system feature before Promise.all
authorPaul Donald <[email protected]>
Sun, 22 Jun 2025 20:35:46 +0000 (22:35 +0200)
committerPaul Donald <[email protected]>
Sun, 22 Jun 2025 20:35:46 +0000 (22:35 +0200)
Allows the hasSystemFeature call to complete before executing the
Promise bundle.

Signed-off-by: Paul Donald <[email protected]>
modules/luci-base/htdocs/luci-static/resources/network.js

index a04f4fce9ecbbf2c08ab62e55eca0baaf517f9ba..953f4f9f68abd7200ed15c0852e87b72af803114 100644 (file)
@@ -349,6 +349,7 @@ function maskToPrefix(mask, v6) {
 
 function initNetworkState(refresh) {
        if (_state == null || refresh) {
+               const hasWifi = L.hasSystemFeature('wifi');
                _init = _init || Promise.all([
                        L.resolveDefault(callNetworkInterfaceDump(), []),
                        L.resolveDefault(callLuciBoardJSON(), {}),
@@ -357,7 +358,7 @@ function initNetworkState(refresh) {
                        L.resolveDefault(callLuciHostHints(), {}),
                        getProtocolHandlers(),
                        L.resolveDefault(uci.load('network')),
-                       L.hasSystemFeature('wifi') ? L.resolveDefault(uci.load('wireless')) : L.resolveDefault(),
+                       hasWifi ? L.resolveDefault(uci.load('wireless')) : L.resolveDefault(),
                        L.resolveDefault(uci.load('luci'))
                ]).then(function(data) {
                        var netifd_ifaces = data[0],